import request from '@/utils/request';

export function login(data) {
  return request({
    url: process.env.VUE_APP_ZHONGTAI_API + '/user/login',
    method: 'post',
    data: JSON.stringify(data),
    params: data
  });
}

export function getInfo(Id) {
  // `/user/${Id}/details?id=${Id}`,
  return request({
    url: process.env.VUE_APP_ZHONGTAI_API + `/user/account/info`,
    method: 'get'
  });
}
export function getMenuList(Id) {
  return request({
    url: process.env.VUE_APP_ZHONGTAI_API + `/user/menu/list`,
    method: 'get'
  });
}

export function getCodeImg() {
  return request({
    url: process.env.VUE_APP_ZHONGTAI_API + '/auth/code',
    method: 'get'
  });
}

export function logout() {
  return request({
    url: process.env.VUE_APP_ZHONGTAI_API + '/user/logout',
    method: 'post'
  });
}

export function resetPswPost(id) {
  return request({
    url: process.env.VUE_APP_ZHONGTAI_API + `/user/${id}/reset`,
    method: 'post'
  });
}
